

class CancelBigParagraph():

    def count_word(self,srt):
        strii = 0
        for soo in str(srt):
            # 统计字符数
            if '\u4e00' <= soo <= '\u9fff':
                strii = strii + 1
        return strii

    def recycle_1(self,listap,wordstr):


        wordstrf=str(wordstr)[:54]
        depar_place2 = int(str(wordstrf).rfind("，")) + 1
        if depar_place2==0:
            word3 = str(wordstr)[:54]
            wordstr = str(wordstr)[54:]
        else:
            word3 = str(wordstr)[:int(depar_place2)]
            wordstr = str(wordstr)[int(depar_place2):]
        listap.append(word3)
        return listap,wordstr

    def recycle_detect_word(self,listap,wordstr):
        word_num2 = self.count_word(wordstr)
        while int(word_num2) > 54:
            listap,wordstr=self.recycle_1(listap, wordstr)
            word_num2 = self.count_word(wordstr)
        listap.append(wordstr)
        return listap

    def cancel_way(self,aftaa):
        aftaa2 = []
        mmki = 0
        for y3 in aftaa:
            # 每段的字符重置数
            strii = 0
            mmki = mmki + 1
            # print(f"删除大段行：{mmki}/{kkkl}")
            word_num = self.count_word(str(y3))
            if int(word_num) > 54:
                aftaa2 = self.recycle_detect_word(aftaa2, str(y3))
            else:
                aftaa2.append(y3)
        return aftaa2

if __name__ == '__main__':
    pass